package com.xingda.packing.task.handle;

import com.xingda.packing.domain.PackProductionLine;
import com.xingda.packing.enums.TaskState;
import com.xingda.packing.enums.TaskType;
import com.xingda.packing.task.ticket.AbstractTaskTicket;

public interface TaskHandleService {

    boolean accept(PackProductionLine productionLine, int area);

    void process(PackProductionLine productionLine, int area);

    default boolean checkTask(AbstractTaskTicket ticket, TaskType taskType) {
        return ticket != null && ticket.getType() == taskType && ticket.getState() == TaskState.NEW;
    }

}

